package marchsoft.modules.four.h5.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import marchsoft.modules.four.common.entity.PracticeRecord;
import marchsoft.modules.four.h5.service.RepositoryService;
import marchsoft.response.Result;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@Api(tags = "前台：题库模块")
@RequestMapping("/api/h5")
public class RepositoryController {

    private final RepositoryService service;

//    @ApiOperation(value = "前台：查询所有安全分类")
//    @GetMapping("/eSafeType/frontAll")
//    public Result<Object> selectAllSafe(){
//        return Result.success(service.selectAllSafeType());
//    }

    @ApiOperation(value = "前台：根据安全分类ID查询相应题库")
    @GetMapping("/eRepository/getBySafeTypeId")
    public Result<Object> selectSafeTypeById(Integer id){
        return Result.success(service.selectRepository(id));
    }


    @ApiOperation(value = "前台：新增练习记录，修改练习记录")
    @PostMapping("/ePracticeRecord")
    public Result<Object> practiceRecord(@RequestBody PracticeRecord practiceRecord){
        return Result.success(service.PracticeRecord(practiceRecord));
    }



}
